package com.daedalus.Inheritanca.Administrata;/*
 * Created with IntelliJ IDEA.
 * Author: Kostika Gorica
 * Date: 12-12-18
 * Time: 3.59.MD
 */

public class Main {

    public static void main(String[] args){

        Punonjes[] punonjesit = new Punonjes[3];

        punonjesit[0] = new PunonjesThjeshte("pn1", "mb1", 1000);
        punonjesit[1] = new PunonjesSalesMan("pn2", "mb2", 1500, 600);
        punonjesit[2] = new PunonjesThjeshte("pn3", "mb3", 2000);

        for (Punonjes pn : punonjesit){
            if ((pn instanceof PunonjesSalesMan)&&((PunonjesSalesMan) pn).shitjet >500 ){
                    pn.rroga = pn.rroga+100;
            }
            System.out.println(pn.emri + " Rroga: "+pn.getEarnings());
        }
    }
}
